package org.bao.netcrawler.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * 
 * get current date and time.
 * @author Bao<bb@feijiao.info>
 * @since 2010-12-24
 * @version 0.9.0
 * @license GPLv3
 */
public class Cal {
	public static String getDateTime(){
		Calendar cal = Calendar.getInstance();
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HHmmss");
		return sdf.format(cal.getTimeInMillis());
	}
	
	public static String getDate(){
		Calendar cal = Calendar.getInstance();
		
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		return sdf.format(cal.getTimeInMillis());
	}
}
